package com.yf.ability.business.sms.config;


import com.alibaba.fastjson.JSON;
import com.yf.ability.business.sms.config.provider.SmsAliyunConfig;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.Map;

@Data
@Configuration
@ConfigurationProperties(prefix = "config.ability.sms")
public class SmsConfig {


    /**
     * 直播服务提供商
     */
    private String provider;

    /**
     * 文件上传配置
     */
    private Map<String,String> data;


    /**
     * 阿里云短信配置
     * @return
     */
    public SmsAliyunConfig getAliConfig(){
        return JSON.parseObject(JSON.toJSONString(data), SmsAliyunConfig.class);
    }


}
